﻿@model IEnumerable<File_Manager.Models.Problemario>

@{
    ViewBag.Title = "Gestión de Problemarios";
}
@Html.Hidden("year", ViewBag.year as string) 
@Html.Hidden("month", ViewBag.month as string) 
@Html.Hidden("day", ViewBag.day as string)

<table class="noBorder" width="100%">
    <tr>
        <td width="60%">
            <h2>Gestión de Problemarios Activos</h2>
        </td>
        <td align="center" width="20%">
            <h4>Fecha Expiración</h4>
            @ViewBag.fecha_exp
        </td>
        <td align="center" width="20%">
            <!-- START COUNTDOWN -->
            <script src="@Url.Content("~/Content/Counter/countdown.js")" type="text/javascript"></script>
            <script type="application/javascript">
                var day = document.getElementById("day").value;
                var month = document.getElementById("month").value;
                var year = document.getElementById("year").value;
                var myCountdownTest = new Countdown({
                    year: year,
                    month: month,
                    day: day,
                    width: 75,
                    height: 60,
                    rangeHi: "day",
                    rangeLo: "day",
                    style: "flip"
                });
            </script>
            <!-- END COUNTDOWN --> <!--$("#elem1");-->
        </td>
    </tr>
</table>
<br />
<div class="error">
    <b>@ViewBag.msn</b>
</div>

<table class="noBorder" width="50%">
    <tr>
        <td>
            <p>
               <a href="/Problemario/Create"><img src="../../Content/images/NewProblemario.png" width="40px" height="40px"/></a><b> @Html.ActionLink("Carga Problemario", "Create")</b>
            </p>
        </td>
        <td>
            <p>
               <a href="/Problemario/SearchIndex"><img src="../../Content/images/ReporteGeneral.png" width="40px" height="40px"/></a> <b>@Html.ActionLink("Reporte General por Alumno", "SearchIndex")</b>
            </p>
        </td>
    </tr>
</table>
<table width="100%" >
    <tr>
        <th style="text-align:center">
            Etapa
        </th>
        <th style="text-align:center">
            Jornada
        </th>
        <th style="text-align:center">
            Grupo
        </th>
        <th style="text-align:center">
            Materia 1
        </th>
        <th style="text-align:center">
            Materia 2
        </th>
        <th style="text-align:center">
            Materia 3
        </th>
        <th style="text-align:center">
            Fecha Limite
        </th>
        <th style="text-align:center">
            Archivo PDF
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr align="center">
        <td>
            @Html.DisplayFor(modelItem => item.nEtapa.name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.idJornada)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.idRol)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.nMateria_1.name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.nMateria_2.name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.nMateria_3.name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.fecha_exp)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.file_name)
        </td>

        <td>
            @Html.ActionLink("Tiempo", "ExtendTime", new { id=item.idPU }) |
            @if (item.idEstado==1)
            {
                @Html.ActionLink("Revisión", "RevisarProblemario", new { id = item.idPU })  <div style="display:inline;"> | </div>
                @Html.ActionLink("Cerrar", "CerrarProblemario", new { id = item.idPU })
            }
            else if (item.idEstado==2)
            {
                @Html.ActionLink("Habilitar", "HabilitarProblemario", new { id = item.idPU })  
            }
        </td>
    </tr>
}

</table>